package com.esaheki.flashcards.uiSupport;

import java.text.Format;

import javax.swing.table.DefaultTableCellRenderer;

@SuppressWarnings("serial")
public class FormatRenderer extends DefaultTableCellRenderer {
	
	private Format formatter;
 
    public FormatRenderer(Format formatter) {
        if (formatter == null)
            throw new NullPointerException();
        this.formatter = formatter;
    }
 
    protected void setValue(Object obj) {
        setText(obj == null? "" : formatter.format(obj));
    }

}
